package com.lobaby.tools;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.WebApplicationInitializer;

/**
 * @author Administrator
 *         Created by Administrator on 2021/3/1 0001.
 */
@SpringBootApplication
@ComponentScan(basePackages = { "com.lobaby.tools.*" })
@ServletComponentScan
public class SpringWebApp extends SpringBootServletInitializer implements WebApplicationInitializer {
    public static ConfigurableApplicationContext run(String[] args) {
        return SpringApplication.run(SpringWebApp.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(SpringFxApplication.class);
    }

    @SuppressWarnings("unused")
    private static SpringApplicationBuilder configureApplication(SpringApplicationBuilder builder){
        return builder.sources(SpringFxApplication.class);
    }
}
